
.PHONY:all test pub clean dist_clean

all:pub
	cp -rf ../encode_html/*.xml usr/local/apache2/htdocs/
	/bin/tar czf web.tgz usr

test:pub
	/bin/tar czf web.tgz usr
	/usr/bin/scp web.tgz 192.168.1.200:/packages
	/usr/bin/scp web.tgz 192.168.1.200:/ldisk/upgrade/
	/usr/bin/ssh 192.168.1.200 /bin/tar xzf /packages/web.tgz

pub:
	rm -rf  usr
	mkdir -p usr/local/apache2/htdocs/ && mkdir -p usr/local/php/lib/php
	cp -rf ../encode_html/css ../encode_html/js ../encode_html/images usr/local/apache2/htdocs/ 
	cp -rf ../encode_html/*.htm usr/local/apache2/htdocs/
	cp -rf *.php usr/local/apache2/htdocs/ 
	cd usr/local/apache2/htdocs && for i in *.php; do encode $$i ; done
	for i in `ls function*`; do ln -s /usr/local/apache2/htdocs/$$i usr/local/php/lib/php/$$i ;done

clean:
	rm -rf web.tgz usr *.txt
dist_clean:clean
	rm -rf tags
